home *** CD-ROM | disk | FTP | other *** search
- ! C68 32 bit integer => 8 byte-floating point conversion routine
- !-----------------------------------------------------------------------------
- ! ported to 68000 by Kai-Uwe Bloem, 12/89
- ! #1 original author: Peter S. Housel 3/28/89
- ! #2 Redid register usage, and then added wrapper routine
- ! to provide C68 IEEE compatibility Dave & Keith Walker 02/92
- ! #3 Redid entry/exit points for C68 v4.3 compatibility
- ! Removed ACK entry points -djw- 09/93
- !-----------------------------------------------------------------------------
-
- BIAS8 = 0x3FF - 1
-
- .sect .text
-
- .define .Xdfltodf
-
- !----------------------------------------
- ! sp Return address
- ! sp+4 value to convert
- ! sp+8 address of result
- !----------------------------------------
- .Xdfltodf:
- move.l 4(sp),a1 ! return value address
- lea 8(sp),a0 ! source address
-
- move.l (a0),d1 ! get the 4-byte integer
- move.w #BIAS8+32-11,d0 ! radix point after 32 bits
- move.w (a0),d2 ! check sign of number
- bge 1f ! nonnegative
- neg.l d1 ! take absolute value
- 1:
- clr.l 4(a1) ! write mantissa onto stack
- move.l d1,(a1)
- clr.w d1 ! set rounding = 0
- jsr .Xnorm8
-
- move.l (sp)+,a1 ! get return address
- add.l #8,sp ! remove parameters from stack
- jmp (a1) ! ... and return
-
-